<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<title>1-iframe-pass cross domain</title>
	<script type="text/javascript" src="../jquery-3.7.1.min.js"></script>
</head>

<body>
	<div>通过iframe传递token</div>
	<input id="change" type="button" style="margin:100px;" value="修改" />

	<iframe hidden="true" id="page" src="http://121.40.165.140:28080/iframe-pass/index1.html"></iframe>
	<script>
		$(document).ready(function () {
			$("#change").click(function () {
				$('#page').attr('src', 'http://121.40.165.140:28080/iframe-pass/index1.html?token=' + 'test-token');
				alert("page的值为：" + $('#page').attr('src'));
			});
		});
	</script>
</body>

</html>